//
//  Message.m
//  SDCycleScrollView
//
//  Created by dllo on 16/09/12
//  Copyright (c) GSD. All rights reserved.
//

#import "Message.h"
#import "MessageItem.h"

@implementation Message

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"Items"]) {
        NSMutableArray<MessageItem *> *items = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            MessageItem *item = [MessageItem modelWithDic:dic];
            [items addObject:item];
        }
        _Items = items;
    }
}

+ (NSDictionary *)objectClassInArray{
    return @{@"Items" : [MessageItem class]};
}

@end
